<!DOCTYPE html>
<html>
<head>
    <title>js面向对象--寄生(parasitic)构造函数模式</title>
    <meta charset="utf-8"/>
    <script>
        function Person(name, age, job){
            //创建要返回的对象
            var o = new Object();

            o.sayName = function(){
                alert(name);
            }
            return o;
        }
        var person = Person("GeoLei", 31, "Software");
        person.sayName();
    </script>
</head>
<body>
</body>
</html>